home *** CD-ROM | disk | FTP | other *** search
/ MacFormat 1996 Christmas / macformat-045.iso / Demos / Grolier Demos / Circus / DEMO_US.EXE / DEMO_US.DXR / 00002.ls < prev    next >
Encoding:
Text File  |  1996-10-31  |  1.9 KB  |  96 lines

  1. on checkMacConfig
  2.   global myColorDepth, MemMngrFlag, mySoundLevel
  3.   set MemMngrFlag to 1
  4.   set myColorDepth to the colorDepth
  5.   set mySoundLevel to the soundLevel
  6.   if myColorDepth <> 8 then
  7.     set the colorDepth to 8
  8.   end if
  9.   initRearWindow()
  10.   if the quickTimePresent <> 1 then
  11.     go("MAC_QT_ABSENT")
  12.     abort()
  13.   end if
  14.   if checkVM() = 1 then
  15.     go("VM_PRESENT")
  16.     abort()
  17.   end if
  18. end
  19.  
  20. on checkVM
  21.   global VM
  22.   set VM to VMPresent(mnew)
  23.   set flag to VM(mVMPresent)
  24.   VM(mdispose)
  25.   return flag
  26. end
  27.  
  28. on FindMacDisk
  29.   global fIO
  30.   set fIO to FileIO(mnew, "read", "circusDM:private:script.isp")
  31.   if fIO > 0 then
  32.     if objectp(fIO) then
  33.       fIO(mdispose)
  34.     end if
  35.     return "circusDM:"
  36.   else
  37.     if objectp(fIO) then
  38.       fIO(mdispose)
  39.     end if
  40.     return EMPTY
  41.   end if
  42. end
  43.  
  44. on initRearWindow
  45.   global rwObj, deskTopPattern, black
  46.   if factory("RearWindow") = 0 then
  47.   end if
  48.   if objectp(rwObj) then
  49.     rwObj(mdispose)
  50.   end if
  51.   makeObjIfNeeded()
  52. end
  53.  
  54. on releaseRearWindow
  55.   global rwObj
  56.   if objectp(rwObj) then
  57.     rwObj(mdispose)
  58.   end if
  59. end
  60.  
  61. on makeObjIfNeeded
  62.   global rwObj
  63.   if not objectp(rwObj) then
  64.     set rwObj to RearWindow(mnew, "M")
  65.     if TestScreen() = 0 then
  66.       exit
  67.     end if
  68.     if value(rwObj) < 0 then
  69.       alert("System error" && rwObj && "trying to create the RearWindow object in RAM (multiple-monitor config).")
  70.       exit
  71.     end if
  72.     if the freeBlock < rwObj(mGetMemoryNeeded) then
  73.       if objectp(rwObj) then
  74.         rwObj(mdispose)
  75.         set rwObj to RearWindow(mnew, "S")
  76.       end if
  77.       if value(rwObj) < 0 then
  78.         alert("System error" && rwObj && "trying to create the RearWindow object in RAM (single-monitor config).")
  79.         exit
  80.       end if
  81.     end if
  82.   end if
  83.   rwObj(mPatToWindow, -5)
  84. end
  85.  
  86. on TestScreen
  87.   global rwObj
  88.   set a to rwObj(mGetScreenBottom)
  89.   set b to rwObj(mGetScreenRight)
  90.   if (a < 481) or (b < 641) then
  91.     releaseRearWindow()
  92.     return 0
  93.   end if
  94.   return 1
  95. end
  96.